'''
图像列表
'''
import re

USER_NAME = "root"
USER_PASSWORLD = "My265746!"
IP_ADDRESS = "192.168.184.101"
DATEBASE = "rebot"
IP_PORT = 3306

LONG_TIME_IMAGE = {
    "from_move_x": "0",
    "from_move_y": "0",
    "lable_image_name": "spare_time_reading",
    "lable_image_num": "60",
    "lable_size_wight": "200",
    "lable_size_height": "200",
    "lable_move_x": "230",
    "lable_move_y": "200",
    "lable_two_image_name": None,
    "lable_two_image_num": None,
    "lable_two_image_wight": None,
    "lable_two_image_height": None,
    "lable_two_move_x": None,
    "lable_two_move_y": None,
    "txt_content": None
}

REBOT_ACTION_BOT_WHICH = ["appear", "map_location_report", "disappear", "attendance_report", "report_eye",
                          "report_eye_not_mouth", "report_mouth", "say_hello", "talk_intercom", "weather_cloudy",
                          "weather_rain", "weather_snow", "weather_sunny", "weather_turned_clear_and_cloudy"]
REBOT_ACTION_TWO_QLABLE_IMAGE = ["alarm_image", "analysis_image", "statistical_work_image", "touring_image"]
REBOT_ACTION_BOT_TXT = ["dialog_box"]

REBOT_ACTION_GROUP_ID = "SELECT A.ORDER_ID,A.FIND_ELEMENT_TYPE,A.FIND_VALUE,A.OP_TYPE,A.OP_VALUE,B.ORDER_GROUP_ID,B.ORDER_GROUP_NAME,B.EXECUTE_ORDER,B.ACTION_ID FROM S_ORDER A,S_ORDER_GROUP B WHERE A.ORDER_ID=B.ORDER_ID AND ORDER_GROUP_ID=%s ORDER BY EXECUTE_ORDER"
REBOT_ACTION_FROM_ID = "SELECT A.ID, FROM_MOVE_X, FROM_MOVE_Y, LABLE_IMAGE_NAME, LABLE_IMAGE_NUM, LABLE_SIZE_WIGHT, LABLE_SIZE_HEIGHT, LABLE_MOVE_X, LABLE_MOVE_Y, LABLE_TWO_IMAGE_NAME, LABLE_TWO_IMAGE_NUM, LABLE_TWO_IMAGE_WIGHT, LABLE_TWO_IMAGE_HEIGHT, LABLE_TWO_MOVE_X, LABLE_TWO_MOVE_Y ,TXT_CONTENT FROM REBOT_ACTIONS_DEMO AS A,S_ORDER_GROUP AS B WHERE A.id=B.ACTION_ID AND B.ORDER_GROUP_ID=%s"

HTTP_IP_HOST = ""
HTTP_IP_PORT = 21567

def FuncReduceHttpRequest(rec):
    '''
    处理数据
    :return:
    '''
    request_lines = rec.splitlines()
    request_start_line = request_lines[0]
    file_name = re.match(r"\w+ +/([^ ]*) ", request_start_line).group(1)
    return str(file_name)